import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 导入ElementUI
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 导入图表插件
import echarts from 'echarts'

// 样式重置以及主题修改
import '@/assets/styles/reset.less'
import '@/assets/styles/themeReset.less'
// 公共样式
import '@/assets/styles/common.less'

// 公共库和插件
import httpTool from './utils/tujia.plugin.httpTool'
import validateTool from './utils/tujia.plugin.validateTool'
import formateTool from './utils/tujia.plugin.formatTool'
import filters from './utils/tujia.plugin.filter'

// 兄弟组件通信
import eventBus from './utils/eventBus'

// 将公用库或者插件挂载到原型上
Vue.prototype.$echarts = echarts
Vue.prototype.httpTool = httpTool
Vue.prototype.validateTool = validateTool
Vue.prototype.formateTool = formateTool
Vue.prototype.Bus = eventBus

// 注册全局复用组件
Vue.component('v-table', resolve => require(['@/components/table/index.vue'], resolve))

Vue.use(ElementUI)

Object.keys(filters).forEach(key => {
	Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
